package main.social.web;

import javax.servlet.http.*;

import main.social.service.AccountService;

import org.apache.commons.logging.*;
import org.springframework.web.servlet.*;
import org.springframework.web.servlet.mvc.*;


public class AccountController implements Controller {

    protected final Log logger = LogFactory.getLog(getClass());
    private AccountService accountService;

    public ModelAndView handleRequest(HttpServletRequest request,
                                      HttpServletResponse response) throws
            Exception {

        logger.info("\nView all my objects .... \n");
        return new ModelAndView("ViewAllAccounts", "accounttModel", this.accountService.getAllAccounts());
    }

    public void setAccountService(AccountService accountService) {
        this.accountService = accountService;
    }

}
